package com.example.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.example.domain.Track;
import com.example.domain.TrzhkEntity;
import com.example.domain.TrzxmEntity;
import com.example.service.TrackService;
import com.example.service.TrzService;




/**
 * 投融资
 * @author user
 *
 */
@RestController
@RequestMapping("/api/trz")
public class TrzController {

	@Autowired
    private TrzService trzService;
	
	@RequestMapping("/list")
    public List<TrzxmEntity> trz(){
        return trzService.getTrz();
    }
	
	@RequestMapping("/year")
    public List<Integer> trzYear(){
        return trzService.getYear();
    }
	/**
	 * 还款信息
	 * @param year
	 * @param startMonth
	 * @param endMonth
	 * @return
	 */
	@RequestMapping("/hklist")
    public ArrayList<TrzhkEntity> trzhk(
    		@RequestParam( required = false,defaultValue = "2007-01-02") String startDate,
    		@RequestParam( required = false,defaultValue = "2188-01-02") String endDate
    		){ 
        return trzService.getHKList(startDate, endDate);
    }
	/**
	 * 项目信息
	 * @return
	 */
	@RequestMapping("/xmlist")
    public ArrayList<TrzxmEntity> trzxm(){
        return trzService.getXMList();
    }
}

